package controllers;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;

public class Connection 
{

	static Socket server;
	private static OutputStream out;
	private static BufferedReader inFromServer;
	
	public static void connectToServer(String host, int port) throws IOException, UnknownHostException
	{
		try 
		{
			server = new Socket(host, port);
			out = server.getOutputStream();
			inFromServer = new BufferedReader(new InputStreamReader (server.getInputStream()));
		} 
		catch (UnknownHostException uhe)
		{
			System.err.println("Cannot recognize host.");
			uhe.printStackTrace();
		}
		catch (IOException ioe)
		{
			System.err.println("I/O failed. Printing where the problem is.");
			ioe.printStackTrace();
		}		
	}

}
